﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BSCMFF.Core.DataAccessLayer;

namespace BSCMFF.Web.Pages
{
    public partial class test : System.Web.UI.Page
    {
        private User u;
        private BSCEntities context;

        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Request.QueryString["EmployeeID"] == null)
            //{
            //    Response.Redirect("EmployeeInfo.aspx?EmployeeID=2");
            //}
            //int employeerID = Convert.ToInt32(Request.QueryString["EmployeeID"]);
            
            context = new BSCEntities();
            u = (from user in context.Users
                 //where user.Login == User.Identity.Name
                 where user.ID == 2
                 select user).Single();

            List<User> users = new List<User>();
            users.Add(u);
            //RadListView1.DataSource = users;
            //RadListView1.DataBind();
        }

        protected void RadButton1_Click(object sender, EventArgs e)
        {
            string s = "da";
        }

        //protected void RadButtonUploadImage_Click(object sender, EventArgs e)
        //{
        //    if (RadUpload1.UploadedFiles.Count == 1)
        //    {

        //        //BSCEntities context = new BSCEntities();
        //        //User u = (from user in context.Users
        //        //          where user.Login == User.Identity.Name
        //        //          select user).Single();
        //        long length = RadUpload1.UploadedFiles[0].InputStream.Length;
        //        ////u.Photo = new byte[length];
        //        byte[] buff = new byte[length];
        //        RadUpload1.UploadedFiles[0].InputStream.Read(buff, 0, (int)length);
        //        ////RadUploadImage.UploadedFiles[0].

        //        //u.Photo = buff;

        //        //context.SaveChanges();
        //        RadBinaryImage1.DataValue = buff;
        //    }
        //}
    }
}